<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script>
    function maopao(arr) {
        for (var i = 0;i <= arr.length - 1;i++){
            for (var o = 0;o <= arr.length - i - 1;o++){
                if(arr[o] < arr[o+1]){
                    var tmp = arr [o];
                    arr[o] = arr[o+1];
                    arr[o+1] = tmp;
                }
            }
        }
        return arr;
    }
    var arr1 = maopao([1,2,3,4,5,6]);
    console.log(arr1);
</script>
<body>

</body>
</html>